#codeing:utf-8

import sqlite3

conn = sqlite3.connect("test.sqlite")
conn.isolation_level = None

conn.execute("create table if not exists t1(id integer primary  key autoincrement,name varchar(128),info varchar(128))")
myname = raw_input("Input name:")
myinfo = raw_input("input info:")
conn.execute("insert into t1(name,info) values('%s', '%s')"%(myname, myinfo))
conn.commit()
cur = conn.cursor()
cur.execute("select * from t1")

res = cur.fetchall()
print 'row:',cur.rowcount
print 'desc',cur.description

for line in res:
    for f in line:
        print f,
    print
print '-'*60

cur.execute("select * from t1")
res = cur.fetchone()
print 'row:',cur.rowcount
for f in res:
    print f,
print

res = cur.fetchone()
print 'row:',cur.rowcount
for f in res:
    print f,
print 
print '-'*60

cur.close()
conn.close()

